home *** CD-ROM | disk | FTP | other *** search
/ Pascal Super Library / Pascal Super Library (CW International)(1997).bin / LIBRARY / SWDOS12 / RENAME.ASM < prev    next >
Assembly Source File  |  1995-02-10  |  1KB  |  39 lines

  1. ;******************************************************************
  2. ;*                           RENAME.ASM                           *
  3. ;*          Source file for SoftWeyr enhanced DOS toolbox         *
  4. ;*                           version 1.1                          *
  5. ;*                 Copyright (c) by SoftWeyr,1994                 *
  6. ;******************************************************************
  7. MODEL TPASCAL
  8. .DATA
  9.      EXTRN DosError :word
  10. .CODE
  11.        Public RenameFile
  12.        EXtrn Asciiz:Far
  13. RenameFile     Proc far OldName:DWORD,NewName:DWORD
  14. ;Procedure RenameFile(OldName,NewName:String);
  15.                 LOCAL AOldName:Byte:80,ANewName:Byte:80=LSIZE
  16.                 Push DS
  17.                 ;Load string address
  18.                 LDS SI,NewName
  19.                 LEA DI,ANewName
  20.                 CALL Asciiz
  21.                 LDS SI,OldName
  22.                 LEA DI,AOldName
  23.                 CALL Asciiz
  24.                 PUSH SS
  25.                 PUSH SS
  26.                 POP DS
  27.                 POP ES
  28.                 LEA DX,AOldName
  29.                 LEA DI,ANewName
  30.                 mov ah,56h
  31.                 Int 21h
  32.                 Pop ds
  33.                 jc @@Error
  34.                 xor ax,ax
  35. @@Error:        mov DosError,Ax
  36.                 RET
  37.               Endp
  38. end
  39.